package com.sx.gongzhong.pest;

import com.sx.gongzhong.model.HeadParamBean;
import com.sx.gongzhong.model.ReplyUserBean;
import com.sx.gongzhong.net.ApiManager;
import com.sx.gongzhong.net.BaseCallBack;
import com.sx.gongzhong.view.MessageUnreadNumView;

import java.util.Map;

/**消息未读数
 * Created by admin on 2018/1/22.
 */

public class MessageUnreadNumPest {
    private MessageUnreadNumView iVoidView;

    public MessageUnreadNumPest(MessageUnreadNumView iVoidView) {
        this.iVoidView = iVoidView;
    }

    //动态信息 未读数量
    public void getDynamicUnreadNum() {
        Map<String,Object> map = HeadParamBean.getHead();
        new ApiManager().getDynamicUnreadNum(map, new BaseCallBack<ReplyUserBean.BaseResult<Integer>>() {
            @Override
            public void onSuccess(ReplyUserBean.BaseResult<Integer> response) {
                iVoidView.getDynamicUnreadNum(response.data +"");
            }
            @Override
            public void onFailures(String message) {
                iVoidView.showError(message);
            }
        });
    }
//系统通知 未读数量
    public void getNotifyUnreadNum() {
        Map<String,Object> map = HeadParamBean.getHead();
        new ApiManager().getNotifyUnreadNum(map, new BaseCallBack<ReplyUserBean.BaseResult<Integer>>() {
            @Override
            public void onSuccess(ReplyUserBean.BaseResult<Integer> response) {
                iVoidView.getNotifyUnreadNum(response.data +"");
            }
            @Override
            public void onFailures(String message) {
                iVoidView.showError(message);
            }
        });
    }
}
